<!--{template common/header}-->

<script type="text/javascript" reload="1">
var jsloadedc = 0, jsloadedst = null;
function jsloaded(src) {
	jsloadedc++;
	if(jsloadedc >= 2) {
		jsloadedst = setInterval(function () { ajaxEditor(); }, 100);
	}
}

function ajaxEditor() {
	if(typeof newEditor != 'function') {
		return;
	}
	editorcurrentheight = 200;
	editorminheight = 200;	
	if(wysiwyg) {
		newEditor(1, bbcode2html(textobj.value));
	} else {
		newEditor(0, textobj.value);
	}
	<!--{if $editor[simplemode] > 0}-->
		editorsimple();
	<!--{/if}-->
	editchange = 1;
	<!--{if !empty($_G['gp_cedit']) && $_G['gp_cedit'] == 'yes'}-->
		loadData(1, $('fastpostform'));
	<!--{/if}-->
	clearInterval(jsloadedst);
}

function fastpostvalidateextra() {
	$('{$editorid}_textarea').value = wysiwyg ? html2bbcode(getEditorContents()) : $('{$editorid}_textarea').value;
	return true;
}

</script>
<div id="{$editorid}_body_loading"><img src="{IMGDIR}/loading.gif" width="16" height="16" class="vm" /> {lang e_editor_loading}</div>
<div class="edt" id="{$editorid}_body" style="display: none">
	<div id="{$editorid}_controls" class="bar">
		<div class="y">
			<div class="b2r nbl nbr" id="{$editorid}_adv_5">
				<p>
					<a id="{$editorid}_undo" title="{lang e_undo}">Undo</a>
				</p>
				<p>
					<a id="{$editorid}_redo" title="{lang e_redo}">Redo</a>
				</p>
			</div>
			<div class="z">
				<span class="mbn"><a id="{$editorid}_fullswitcher"></a><a id="{$editorid}_simple"></a></span>
				<label id="{$editorid}_switcher" class="bar_swch ptn"><input id="{$editorid}_switchercheck" type="checkbox" class="pc" name="checkbox" value="0" {if !$editor[editormode]}checked="checked"{/if} onclick="switchEditor(this.checked?0:1)" />{lang code}</label>
			</div>
		</div>
		<!--{if !empty($_G[setting][pluginhooks][ajax_editorctrl_right])}-->
			<div class="y"><!--{hook/ajax_editorctrl_right}--></div>
		<!--{/if}-->
		<div id="{$editorid}_button" class="btn cl">
			<div class="b1r" id="{$editorid}_adv_s0">
				<a id="{$editorid}_paste" title="{lang e_paste}">{lang e_paste}</a>
			</div>
			<div class="b2r nbr" id="{$editorid}_adv_s2">
				<a id="{$editorid}_fontname" class="dp" title="{lang e_fontname}"><span id="{$editorid}_font">{lang e_font}</span></a>
				<a id="{$editorid}_fontsize" class="dp" title="{lang e_fontsize}"><span id="{$editorid}_size">{lang e_size}</span></a>
				<br id="{$editorid}_adv_1" />
				<a id="{$editorid}_bold" title="{lang e_bold}">B</a>
				<a id="{$editorid}_italic" title="{lang e_italic}">I</a>
				<a id="{$editorid}_underline" title="{lang e_underline}">U</a>
				<a id="{$editorid}_forecolor" title="{lang e_forecolor}">Color</a>
				<a id="{$editorid}_backcolor" title="{lang e_fontbgcolor}">BgColor</a>
				<a id="{$editorid}_url" title="{lang e_url}">Url</a>
				<span id="{$editorid}_adv_8">
				<a id="{$editorid}_unlink" title="{lang e_unlink}">Unlink</a>
				<a id="{$editorid}_inserthorizontalrule" title="{lang e_hr_title}">Hr</a>
				</span>
			</div>
			<div class="b2r nbl" id="{$editorid}_adv_2">
				<p id="{$editorid}_adv_3">
					<a id="{$editorid}_tbl" title="{lang e_table}">Table</a>
				</p>
				<p>
					<a id="{$editorid}_removeformat" title="{lang e_removeformat}">Removeformat</a>
				</p>
			</div>
			<div class="b2r">
				<p>
					<a id="{$editorid}_justifyleft" title="{lang e_left}">Left</a>
					<a id="{$editorid}_justifycenter" title="{lang e_center}">Center</a>
					<a id="{$editorid}_justifyright" title="{lang e_right}">Right</a>
				</p>
				<p id="{$editorid}_adv_4">
					<a id="{$editorid}_autotypeset" title="{lang e_autotypeset}">Autotypeset</a>
					<a id="{$editorid}_insertorderedlist" title="{lang e_orderedlist}">Orderedlist</a>
					<a id="{$editorid}_insertunorderedlist" title="{lang e_unorderedlist}">Unorderedlist</a>
				</p>
			</div>
			<div class="b1r" id="{$editorid}_adv_s1">
				<a id="{$editorid}_sml" title="{lang e_smilies_title}">{lang e_smilies}</a>
				<div id="{$editorid}_imagen" style="display:none">!</div>
				<a id="{$editorid}_image" title="{lang e_image_title}">{lang e_image}</a>
				<!--{hook/ajax_editorctrl_left}-->
			</div>
			<div class="b2r" id="{$editorid}_adv_6">
				<p>
					<a id="{$editorid}_code" title="{lang e_code_title}">{lang e_code}</a>					
				</p>
				<p>
					<a id="{$editorid}_quote" title="{lang e_quote_title}">{lang e_quote}</a>
				</p>
			</div>
			<!--{if $_G['setting']['magicstatus'] && !empty($_G['setting']['magics']['doodle'])}-->
				<div class="b2r" id="{$editorid}_adv_7">
					<a href="home.php?mod=magic&mid=doodle&showid=comment_doodle&target={$editorid}_textarea&from=forumeditor" class="cst" onclick="showWindow(this.id, this.href, 'get', 0)"><img src="{STATICURL}image/magic/doodle.small.gif" alt="doodle" title="$_G['setting']['magics']['doodle']" style="margin-top:2px" /></a>
				</div>
			<!--{/if}-->
		</div>
	</div>

	<div class="area">
		<textarea name="$editor[textarea]" id="{$editorid}_textarea" class="pt" tabindex="1" rows="15">$editor[value]</textarea>
	</div>
	<!--{subtemplate common/editor}-->
</div>

<div id="{$editorid}_menus" class="editorrow" style="overflow: hidden; margin-top: -5px; height: 0; border: none; background: transparent;">
	<!--{subtemplate common/editor_menu}-->
</div>

<div class="p_pof uploadfile" id="{$editorid}_image_menu" style="display: none" unselectable="on">
	<div class="p_opt popupfix" unselectable="on" id="{$editorid}_www">
		<table cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<th width="74%">{lang e_img_inserturl}</th>
				<th width="13%">{lang e_img_width}</th>
				<th width="13%">{lang e_img_height}</th>
			</tr>
			<tr>
				<td><input type="text" id="{$editorid}_image_param_1" onchange="loadimgsize(this.value)" style="width: 95%;" value="" class="px" autocomplete="off" /></td>
				<td><input id="{$editorid}_image_param_2" size="1" value="" class="px p_fre" autocomplete="off" /></td>
				<td><input id="{$editorid}_image_param_3" size="1" value="" class="px p_fre" autocomplete="off" /></td>
			</tr>
			<tr>
				<td colspan="3" class="pns mtn">
					<button type="button" class="pn pnc" id="{$editorid}_image_submit"><strong>{lang submit}</strong></button>
					<button type="button" class="pn" onclick="hideMenu();"><em>{lang cancel}</em></button>
				</td>
			</tr>
		</table>
	</div>
</div>

<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />

<!--{template common/footer}-->